<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
   
    <ui:composition template="/views/_template.xhtml">
        <ui:define name="corpo">
            <div >
                <h4>
                    <h:outputLabel style="text-align: right; margin-left: 720px; color: #99a699;" value="Total de registro: #{contaBean.contRegistro}" />
                </h4>
                <h:outputLabel value="Perfil" style="border-bottom: 3px solid #C22; text-align: left; font-size: 18px; width: 900px;" />    
            </div>
            <h:form>                  
                <p:dataTable styleClass="dados" value="#{perfilBean.perfis}" var="perfil" emptyMessage="Nenhum registro encontrado!">
                    <p:column style="width: 10px; text-align: left" headerText="ID">
                            <h:outputText value="#{perfil.id}" />
                    </p:column>
                    <p:column style="width: 650px" headerText="Nome" >
                        <h:outputText value="#{perfil.descricao}"/>
                   </p:column>
                    <p:column style="width: 100px" headerText="Permissão" >
                        <h:outputText value="#{perfil.tipoPerfil}"/>
                   </p:column>
                    <p:column style="width: 10px;" headerText="Visualizar dados">
                      <center>
                          <h:commandLink  action="visualizaConta">
                              <h:graphicImage library="imagens" name="ico_visualizar.gif" style="width: 30px; height: 20px;" />
                          </h:commandLink>
                      </center>
                  </p:column>
                  <p:column style="width: 10px;" headerText="Alterar">
                      <center>
                          <h:commandLink action="#{perfilBean.alterar(perfil)}">
                              <h:graphicImage library="imagens" name="edit-icon.gif" style="width: 30px; height: 20px;" />
                          </h:commandLink>
                      </center>
                  </p:column>
                  <p:column style="width: 10px;" headerText="Excluir">
                      <center>
                          <h:commandLink action="#{perfilBean.remover(perfil)}">
                              <h:graphicImage library="imagens" name="icon_delete.gif" style="width: 30px; height: 20px;" />
                          </h:commandLink>
                      </center>
                  </p:column>
                 </p:dataTable><br />
                <h:commandButton value="Novo" action="incluirPerfil"/>
                <h:commandButton value="Voltar" action="index" immediate="true"/>
            </h:form>

        </ui:define>
    </ui:composition>
</html>

